package com.ourteam.product.model.api;

import com.ourteam.frame.web.AbstractSearchModel;
import com.ourteam.product.model.dao.ProductModelActionDAOQueryBean;
import com.ourteam.product.model.domain.ProductModelActionBean;

public class ProductModelActionSearchModel extends AbstractSearchModel<ProductModelActionDAOQueryBean> {
	
	private long objectId;
	
	public long getObjectId() {
		return objectId;
	}

	public void setObjectId(long objectId) {
		this.objectId = objectId;
	}

	@Override
	public String getMappedDAOField(String aProperty) {
		return ProductModelActionBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(ProductModelActionDAOQueryBean queryBean) throws Exception {
		
		ProductModelActionDAOQueryBean.Criteria criteria = queryBean.createCriteria();
		
		if(objectId != 0) {
			criteria.andObjectIdEqualTo(objectId);
		}
		
	}

}
